#include <stdio.h>
#include <string.h>

unsigned int my_strlen(const char *str)
{
    int index = 0;
    while (1)
    {
        if (str[index] == '\0')
        {
            return index;
        }
        index++;
    }
}

void my_strcpy(char *str1, char *str2)
{
}

int my_strcmp(char *str1, char *str2)
{
    int index = 0;
    while (1)
    {
        char strIndex1 = str2[index];
        char strIndex2 = str1[index];

        if (strIndex1 == strIndex2)
        {
            index++;
            continue;
        }
        return strIndex1 > strIndex2 ? 1 : -1;
    }
    return 0;
}

int main(int argc, char const *argv[])
{
#if 0
    char arr1[] = "The company last announced";
    char arr2[] = "increase in 2018, citing the";
    char arr3[] = "impact of aluminum under President";
    char arr4[] = "Donald Trump in the midst";
    char arr5[] = "his first month in the White";
    char arr6[] = "and feeling frustrated3 that he cannot spend";

    int arrLen1 = my_strlen(arr1);
    int len1 = strlen(arr1);

    int arrLen2 = my_strlen(arr2);
    int len2 = strlen(arr2);

    int arrLen3 = my_strlen(arr3);
    int len3 = strlen(arr3);

    int arrLen4 = my_strlen(arr4);
    int len4 = strlen(arr4);

    int arrLen5 = my_strlen(arr5);
    int len5 = strlen(arr5);

    int arrLen6 = my_strlen(arr6);
    int len6 = strlen(arr6);

    printf("%d", arrLen1 == len1);
    printf("%d", arrLen2 == len2);
    printf("%d", arrLen3 == len3);
    printf("%d", arrLen4 == len4);
    printf("%d", arrLen5 == len5);
    printf("%d", arrLen6 == len6);

#endif

#if 1
    char str1[] = "The ";
    char str2[] = "The";
    char str3[] = "school";

    int my_ret1 = my_strcmp(str1, str2);
    int ret1 = strcmp(str1, str2);

    int my_ret2 = my_strcmp(str1, str3);
    int ret2 = strcmp(str1, str3);

    printf("%d", my_ret1 == ret1);
    printf("%d", my_ret2 == ret2);

#endif
    /* code */
    return 0;
}
